package com.i2works.smartluolong.web.dal.user.dao;


import com.i2works.smartluolong.utils.basecommon.BaseCommonDAO;
import com.i2works.smartluolong.utils.exception.DAOException;
import com.i2works.smartluolong.web.entity.common.SelectDO;
import com.i2works.smartluolong.web.entity.user.UserAccountDO;
import com.i2works.smartluolong.web.entity.user.UserAccountQuery;
import com.i2works.smartluolong.web.entity.user.UserAccountRoleDO;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 用户基础DAO接口
 *
 * @author Liu Yutao
 * @className IUserAccountDAO
 * @email koal@vip.qq.com
 * @date 2016/2/7 17:12
 */
@Repository("userAccountDAO")
public interface IUserAccountDAO extends BaseCommonDAO<UserAccountQuery, UserAccountDO> {

    /**
     * 查询一个普通用户（登陆）
     */
    UserAccountDO queryLoginUser(String value) throws DAOException;

    /**
     * 查询用户详细列表
     */
    List<UserAccountDO> queryUserDetailsList(UserAccountQuery query) throws DAOException;

    /**
     * 查询用户详细列表(后台API)
     */
    List<UserAccountDO> queryUserInfoApiList(UserAccountQuery query) throws DAOException;

    /**
     * 查询用户详细列表总量(后台API)
     */
    Integer queryUserInfoApiCount(UserAccountQuery query) throws DAOException;


    /**
     * 查询用户详细列表总量
     */
    Integer queryUserDetailsCount(UserAccountQuery query) throws DAOException;

    /**
     * 查询某会员的角色列表
     */
    List<SelectDO> queryRoleSelect(Integer userId) throws DAOException;

    /**
     * 更新用户密码
     */
    void updatePassword(UserAccountDO userAccountDO) throws DAOException;
    
    /**
     * 根据手机号更新用户
     */
    void updateByPhone(UserAccountDO userAccountDO) throws DAOException;

    /**
     * 添加用户角色
     */
    void saveUserRole(UserAccountRoleDO userRole) throws DAOException;

    /**
     * 删除某会员的角色
     */
    void deleteUserRole(Integer accountId) throws DAOException;

    /**
     * 删除某会员的角色
     */
    void deleteBatchUserRole(List<Integer> idList) throws DAOException;

}
